<?php

namespace app\models;

use Yii;

/**
 * This is the model class for table "{{%creative_ssp}}".
 *
 * @property integer $id
 * @property integer $creative_id
 * @property integer $form
 * @property string $category_id
 * @property integer $ad_network_id
 * @property integer $ssp_material_id
 * @property string $ssp_url
 * @property string $ssp_creative_id
 * @property integer $status
 * @property integer $ssp_audit_status
 * @property string $creative_code
 * @property string $last_update
 */
class CreativeSsp extends \app\models\BaseAR
{
    /**
     * @inheritdoc
     */
    public static function tableName()
    {
        return '{{%creative_ssp}}';
    }

    /**
     * @inheritdoc
     */
    public function rules()
    {
        return [
            [['creative_id'], 'required'],
            [['creative_id', 'form', 'ad_network_id', 'ssp_material_id', 'status', 'ssp_audit_status'], 'integer'],
            [['creative_code'], 'string'],
            [['last_update'], 'safe'],
            [['category_id', 'ssp_url'], 'string', 'max' => 255],
            [['ssp_creative_id'], 'string', 'max' => 128],
            [['creative_id', 'ad_network_id'], 'unique', 'targetAttribute' => ['creative_id', 'ad_network_id'], 'message' => 'The combination of Creative ID and Ad Network ID has already been taken.']
        ];
    }

    /**
     * @inheritdoc
     */
    public function attributeLabels()
    {
        return [
            'id' => 'ID',
            'creative_id' => 'Creative ID',
            'form' => 'Form',
            'category_id' => 'Category ID',
            'ad_network_id' => 'Ad Network ID',
            'ssp_material_id' => 'Ssp Material ID',
            'ssp_url' => 'Ssp Url',
            'ssp_creative_id' => 'Ssp Creative ID',
            'status' => 'Status',
            'ssp_audit_status' => 'Ssp Audit Status',
            'creative_code' => 'Creative Code',
            'last_update' => 'Last Update',
        ];
    }
}
